import java.util.Objects;

public class MyDate {
    private String name;
    private String sex;
    private int age;

    public MyDate(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MyDate myDate = (MyDate) o;
        return Objects.equals(name, myDate.name) &&
                Objects.equals(sex, myDate.sex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, sex);
    }
}

class TestMyDate{
    public static void main(String[] args) {



        MyDate S1=new MyDate("拉拉","女",18);
        MyDate S2=new MyDate("拉拉","女",18);
        System.out.println("s1是否等于s2："+(S1.equals(S2)));


}}
